package cn.xrj.springcloud.service;

import cn.xrj.springcloud.pojo.Qcpage;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class ServiceFallBackFactory implements FallbackFactory {
    @Override
    public JobInfoService create(Throwable cause) {
        return new JobInfoService() {
            @Override
            public List<Qcpage> getAll() {
                return null;
            }

            @Override
            public Qcpage getById(Integer id) {
                Qcpage qcpage=new Qcpage()
                        .setId(id)
                        .setJob("该服务暂时关闭，敬请谅解")
                        .setPlace("该服务暂时关闭，敬请谅解")
                        .setCompany("该服务暂时关闭，敬请谅解")
                        .setData("该服务暂时关闭，敬请谅解")
                        .setDbsource("该服务暂时关闭，敬请谅解")
                        .setSalar("该服务暂时关闭，敬请谅解");
                return qcpage;
            }

            @Override
            public boolean deleteById(Integer id) {
                return false;
            }
        };
    }
}
